package fr.vvins.core.user.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import fr.vvins.core.catalog.entity.Product;
import fr.vvins.core.catalog.entity.Vigneron;
import fr.vvins.core.dao.EntityImpl;


/**
 * Log entity
 */
@Entity
@Table(schema="vvins", name="VV_LOG")

public class UserLog extends EntityImpl implements Serializable {

	private static final long serialVersionUID = -2036119175439571345L;
	@Id
	@GeneratedValue
	@Column(name="ID")
	private Integer id;
	@ManyToOne
	@JoinColumn(name="USER_ID")
	private User user;
	@Basic
	@Column(name="DATE")
	private Date date;
	@Basic
	@Column(name="LOG")
	private String log;
	@ManyToOne
	@JoinColumn(name="ACTION_ID")
	private UserLogAction action;
	@ManyToOne
	@JoinColumn(name="VIGNERON_ID")
	private Vigneron vigneron;
	@ManyToOne
	@JoinColumn(name="PRODUCT_ID")	
	private Product product;

	public UserLog() {
	}

	public UserLog(Integer id, User user, Date date, String log) {
		super();
		this.id = id;
		this.user = user;
		this.date = date;
	
	}

	@Override
	public Integer getId() {
		return id;
	}

	@Override
	public void setId(Integer id) {
		this.id = id;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public UserLogAction getAction() {
		return action;
	}

	public void setAction(UserLogAction action) {
		this.action = action;
	}

	public Vigneron getVigneron() {
		return vigneron;
	}

	public void setVigneron(Vigneron vigneron) {
		this.vigneron = vigneron;
	}

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public String getLog() {
		return log;
	}

	public void setLog(String log) {
		this.log = log;
	}

}
